package org.yx.controller;

import io.jboot.web.controller.JbootController;
import io.jboot.web.controller.annotation.RequestMapping;

import org.yx.utils.Const;

import com.xiaoleilu.hutool.io.resource.ResourceUtil;
import com.xiaoleilu.hutool.util.CharsetUtil;
import com.xiaoleilu.hutool.util.StrUtil;

@RequestMapping("/rpt")
public class GridReportController extends JbootController {
	public void index() {
		renderText("rpt");
	}

	public void template() {
		String grf = getPara();
		if (StrUtil.isNotBlank(grf)) {
			grf += (StrUtil.endWith(grf, ".grf", true) ? "" : ".grf");
			String result = ResourceUtil.readStr("files/template/" + grf, CharsetUtil.charset(Const.UTF8));
			renderText(result);
		}
	}
}
